CREATE TABLE [dbo].[TTPARA_PRGM]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_MODU] [dbo].[TD_VC_008] NOT NULL,
[CO_MENU] [dbo].[TD_VC_020] NOT NULL,
[CO_ATRI] [dbo].[TD_VC_020] NOT NULL,
[NU_CORR_ATRI] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTPARA_PR__NU_CO__731B1205] DEFAULT ((0)),
[ST_RANG] [dbo].[TD_VC_001_SINO] NULL,
[ST_SELE] [dbo].[TD_VC_001_SINO] NULL,
[ST_SIMI] [dbo].[TD_VC_001_SINO] NULL,
[NU_PRED] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTPARA_PR__NU_PR__76EBA2E9] DEFAULT ((0)),
[ST_EXCL] [dbo].[TD_VC_001_SINO] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTPARA_PR__CO_US__78D3EB5B] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTPARA_PR__FE_US__79C80F94] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTPARA_PR__CO_US__7ABC33CD] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTPARA_PR__FE_US__7BB05806] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTPARA_PRGM] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_EX__77DFC722] CHECK NOT FOR REPLICATION (([ST_EXCL]='N' OR [ST_EXCL]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRGM] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_RA__740F363E] CHECK NOT FOR REPLICATION (([ST_RANG]='N' OR [ST_RANG]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRGM] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_SE__75035A77] CHECK NOT FOR REPLICATION (([ST_SELE]='N' OR [ST_SELE]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRGM] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_SI__75F77EB0] CHECK NOT FOR REPLICATION (([ST_SIMI]='N' OR [ST_SIMI]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRGM] ADD CONSTRAINT [PK__TTPARA_P__181EEB4A6FD49106] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTPARA_PRGM] ADD CONSTRAINT [FK__TTPARA_PRGM__54EB90A0] FOREIGN KEY ([CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI]) REFERENCES [dbo].[TTATRI_SIST] ([CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI])
GO
GRANT SELECT ON  [dbo].[TTPARA_PRGM] TO [public]
GRANT INSERT ON  [dbo].[TTPARA_PRGM] TO [public]
GRANT DELETE ON  [dbo].[TTPARA_PRGM] TO [public]
GRANT UPDATE ON  [dbo].[TTPARA_PRGM] TO [public]
GO
